package com.king.mapper;

import com.king.pojo.dto.UserDTO;
import com.king.pojo.entity.SysUser;
import com.king.pojo.vo.UserQueryVO;
import org.mapstruct.BeanMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

@Mapper
public interface UserMapper {

//    @BeanMapping(ignoreByDefault = true)
//    UserVO sysUserToUserVO(SysUser user);

    List<UserQueryVO> sysUserToUserVO(List<SysUser> userList);

    @Mapping(target = "createTime", source = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(target = "updateTime", source = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    UserQueryVO sysUserToUserVO(SysUser user);

    @BeanMapping(ignoreByDefault = true)
    SysUser userDtosToSysUsers(UserDTO userDto);


}
